@echo off

for %%i in (protoc-*.zip) do (
    set ProtocZip=%%i
)
if "%ProtocZip%"=="" (
    echo Proto zip file not found!!!
    pause
    goto:eol
)

set ProtocFolder=%ProtocZip:~0,-4%
echo Protoc folder name is %ProtocFolder%

if not exist %ProtocFolder% (
    echo Please unzip .\%ProtocZip% to .\%ProtocFolder%
    pause
    goto:eol
)


%ProtocFolder%\bin\protoc^
            -I=.^
            -I=.\%ProtocFolder%\include^
            --proto_path=.^
            --go_out=.^
            --go_opt=paths=source_relative^
            *.proto
pause